
<div class="noidung">
    <?php $urlbtnxem = 'http://chomoionline.com/icon/btnxem.PNG'; ?>
    <div style="padding-left: 0px; width: 100%">
        <div class="colleft">
            <?php $this->renderPartial('commercial'); ?>
        </div>
        <div class="colright" style="margin: 0px">
            <div style="margin-left: 7px; width: 100%">
                <?php
                $css = "bgtopic340";
                $dem = null;
                if (!empty($category)) {
                    $dem = $category->catename;

                    if (strlen($dem) >= 60) {
                        $css = "bgtopic600";
                    } else if (strlen($dem) >= 39) {
                        $css = "bgtopic500";
                    }
                }
                //  echo $sql;
                ?>


                <div class="<?php echo $css; ?>">
                    <div class="topic_title">
                        <?php
                        if (!empty($category)) {
                            echo $category->catename;
                        } else if (!empty($result)) {
                            echo $result;
                        }
                        ?>
                    </div>
                </div>

               
                <?php
                if (!empty($produc)) {
                    ?>
                <ul id="itemContainer0" style="list-style-type: none; margin-left: -40px">
                <?php
                    foreach ($produc as $pr) {
                        ?>
                    <li>
                        <div class="boxsp">
                            <div class="sale">
                                <div class="txtdiscount">
                                    <?php
                                    if ($pr->discount > 1000) {
                                        echo '<div style="padding-top: 5px;font-size: 16px;">Quà</div>';
                                    } elseif ($pr->discount > 999) {
                                        echo '<div style="padding-top: 5px;font-size: 16px;">Mới</div>';
                                    } else {
                                        echo $pr->discount . '<span>%</span>';
                                    }
                                    ?>

                                </div>
                            </div>
                            <div class="boxspImg">
                                <?php
                                $getUrl = $pr->pr_url;
                                $tang = "_top";
                                if ($getUrl === "") {
                                    $getUrl = $this->createUrl('/noi-dung') . '/' . $pr->prid . '/' . $pr->asia_name . '/';
                                } else {
                                    $tang = "_blank";
                                }
                                ?>
                                <a href="<?php echo $getUrl; ?>" title="<?php echo $pr->pr_name; ?>" target="<?php echo $tang; ?>">
                                    <img src="<?php echo Yii::app()->request->baseUrl . '/upload/product/avata/' . $pr->avatar ?>" width="190" height="205">
                                </a>
                            </div>
                            <div class="boxspTitle">
                                <a href="<?php echo $getUrl; ?>" title="<?php echo $pr->pr_name; ?>" target="<?php echo $tang; ?>">
                                    <?php echo $pr->pr_name; ?>
                                </a>
                            </div>
                            <div class="boxspPrice">
                                <div class="txttimer">
                                    <div class="product-date-<?php echo $pr->prid; ?>"></div>

                                    <script>
                                        jQuery(document).ready(function() {

                                        jQuery(".product-date-<?php echo $pr->prid; ?>").countdown({
        <?php
        if (($pr->pr_enddate) == '') {
            $date = "1/1/2013 0:0:0";
        } else {
            $dd =date('Y-m-d',strtotime($pr->pr_enddate));
            if($dd==date('Y-m-d')){
               
                $date = date('Y-m-d', strtotime($dd. ' + 2 day'));
               
            }elseif ($dd==date('Y-m-d', strtotime(date('Y-m-d'). ' + 1 day'))) {
                 $date = date('Y-m-d', strtotime($dd. ' + 1 day'));
            }
            else {
                $date = $pr->pr_enddate;
            }
            
        }
        ?>

                                        date: "<?php echo $date; ?>",
                                                render: function(data) {
                                                jQuery(this.el).html("Còn " + this.leadingZeros(data.days, 2) + " <span> ngày </span>");
                                                }
                                        });
                                        });</script>
                                </div>
                                <div class="btnXem">

                                    <a href="<?php echo $getUrl; ?>" title="<?php echo $pr->pr_name; ?> " target="<?php echo $tang; ?>"><img src="<?php echo $urlbtnxem; ?>"></a>
                                </div>
                            </div>
                        </div>
                    </li>
                        <?php
                    }
                    ?>
                    </ul>
                <?php
                }
                ?>
                
                <div class="clear"></div>
                <div class="holder0"></div>
            

                <div class="clear"></div>





                <?php
                if (!empty($producorder)) {
                    ?>
                    <div class="<?php echo $css; ?>">
                        <div class="topic_title">
                            Sản phẩm khác
                        </div>
                    </div>
                    <ul id="itemContainer" style="list-style-type: none; margin-left: -40px">
                        <?php
                        foreach ($producorder as $pr) {
                            ?>
                            <li>
                                <div class="boxsp">
                                    <div class="sale">
                                        <div class="txtdiscount">
                                            <?php
                                            if ($pr->discount > 1000) {
                                                echo '<div style="padding-top: 5px;font-size: 16px;">Quà</div>';
                                            } elseif ($pr->discount > 999) {
                                                echo '<div style="padding-top: 5px;font-size: 16px;">Mới</div>';
                                            } else {
                                                echo $pr->discount . '<span>%</span>';
                                            }
                                            ?>

                                        </div>
                                    </div>
                                    <div class="boxspImg">
                                        <?php
                                        $getUrl = $pr->pr_url;
                                        $tang = "_top";
                                        if ($getUrl === "") {
                                            $getUrl = $this->createUrl('/noi-dung') . '/' . $pr->prid . '/' . $pr->asia_name . '/';
                                        } else {
                                            $tang = "_blank";
                                        }
                                        ?>
                                        <a href="<?php echo $getUrl; ?>" title="<?php echo $pr->pr_name; ?>" target="<?php echo $tang; ?>">
                                            <img src="<?php echo Yii::app()->request->baseUrl . '/upload/product/avata/' . $pr->avatar ?>" width="190" height="205">
                                        </a>
                                    </div>
                                    <div class="boxspTitle">
                                        <a href="<?php echo $getUrl; ?>" title="<?php echo $pr->pr_name; ?>" target="<?php echo $tang; ?>">
                                            <?php echo $pr->pr_name; ?>
                                        </a>
                                    </div>
                                    <div class="boxspPrice">
                                        <div class="txttimer">
                                            <div class="product-date-<?php echo $pr->prid; ?>"></div>

                                            <script>
                                                        jQuery(document).ready(function() {

                                                jQuery(".product-date-<?php echo $pr->prid; ?>").countdown({
        <?php
        if (($pr->pr_enddate) == '') {
            $date = "1/1/2013 0:0:0";
        } else {
            $dd =date('Y-m-d',strtotime($pr->pr_enddate));
            if($dd==date('Y-m-d')){
               
                $date = date('Y-m-d', strtotime($dd. ' + 2 day'));
               
            }elseif ($dd==date('Y-m-d', strtotime(date('Y-m-d'). ' + 1 day'))) {
                 $date = date('Y-m-d', strtotime($dd. ' + 1 day'));
            }
            else {
                $date = $pr->pr_enddate;
            }
            
        }
        ?>

                                                date: "<?php echo $date; ?>",
                                                        render: function(data) {
                                                        jQuery(this.el).html("Còn " + this.leadingZeros(data.days, 2) + " <span> ngày </span>");
                                                        }
                                                });
                                                });

                                            </script>
                                        </div>
                                        <div class="btnXem">

                                            <a href="<?php echo $getUrl; ?>" title="<?php echo $pr->pr_name; ?> " target="<?php echo $tang; ?>"><img src="<?php echo $urlbtnxem; ?>"></a>
                                        </div>
                                    </div>
                                </div>
                            </li>
                            <?php
                        }
                        ?>
                             </ul>
                <?php
                    }
                    ?>
                    <div class="clear"></div>
               
                <div class="clear"></div>

                <div class="holder"></div>
            </div>
        </div>
    </div>

    <div style="clear: both; padding-bottom: 10px"></div>
</div>


